<?php
namespace app\common\validate;

use think\Validate;

class CaseCatValidate extends Validate{

    protected $rule = [
        'name'=>'require',    //名称可以相同
        'pid'=>'number',
    ];

    protected $message = [
        'name.require'=>'栏目不能为空',
        'pid.number'=>'请选择父栏目',
    ];

    protected $scene = [
        'add' => ['name','pid'],
        'edit'=> ['name','pid'],
    ];
}